FROM dockerpull.cn/python:3.10-slim

WORKDIR /app

RUN sed -i 's/deb.debian.org/mirrors.huaweicloud.com/g' /etc/apt/sources.list.d/debian.sources;
#RUN apt update && apt install -y build-essential portaudio19-dev
RUN apt update && apt install -y portaudio19-dev ffmpeg gcc g++ && apt clean

RUN mkdir ~/.pip; \
    echo "[global]" > ~/.pip/pip.conf; \
    echo "index-url = https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.pip/pip.conf
COPY requirements.txt .
COPY cosyvoice2/CosyVoice-ttsfrd/ttsfrd_dependency-0.1-py3-none-any.whl .
COPY cosyvoice2/CosyVoice-ttsfrd/ttsfrd-0.4.2-cp310-cp310-linux_x86_64.whl .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt; \
    pip install ttsfrd_dependency-0.1-py3-none-any.whl; \
    pip install ttsfrd-0.4.2-cp310-cp310-linux_x86_64.whl

#CMD ["/bin/bash"]
CMD ["python", "web.py"]